<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta content="telephone=no" name="format-detection" />
	<meta name="Description" content=""/>
	<meta name="Keywords" content=""/>
	<link href="favicon.ico" mce_href="favicon.ico" rel="bookmark" type="image/x-icon" />
	<link href="favicon.ico" mce_href="favicon.ico" rel="icon" type="image/x-icon" />
	<link href="favicon.ico" mce_href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
	<title>盖网魔盒</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/styles.css">
	<script src="js/jquery-2.2.2.min.js"></script>
	<script src="js/jquery.flexslider-min.js"></script>
	<script src="js/common.js"></script>	
	<script src="json/videoJson.js"></script>
	<script>
		$(function(){
			if(window.name=="gwmhLogined"){
				$("#authentication").attr("href","hasLogined.html");
			}

			$("#share-btn").click(function(){
				$("#share").show();
			})
			$(".share-tip-box .close").click(function(){
				$(this).parent().parent().hide();
			})
			$(".nav a").click(function(){
				var num=$(this).attr("tag");
				$(".nav a").removeClass("active");
				$(this).addClass("active");
				$(".video-list").hide();
				$("#video-list"+num).show();
			});

			$(videoData).each(function(){							
				var pid = this.pid;
				var cid = this.cid;
				var href = this.href;
				var img = this.img;
				var child=this.child;
				var sharer=this.sharer;	
				var videoName = this.videoName;				 
	         	if(this.childitem.length!=0){//有二级分类
	         		var li="<li><a href='"+href+"' title='"+child+"'><img src='"+img+"' alt='"+child+"'/><div class='info'><p class='video-name'>《"+child+"》</p><p class='sharer'>分享者："+sharer+"</p></div></a></li>";
	         		$("#video-list"+pid).prepend(li);
	         		$.getUrlParam = function (name) {  
		             	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");  
		             	var r = window.location.search.substr(1).match(reg);  
		             	if (r != null) return unescape(r[2]); return null;  
		         	}
	         		if($.getUrlParam('pid')!=null){  //二级分类列表
	         			$(".nav").hide();
	         			$("#video-list"+$.getUrlParam('pid')).show().siblings().hide();			
	         			$(this.childitem).each(function(){      
	         				pid=this.pid;   				
	         				href=this.href;
	         				img=this.img;
	         				videoName=this.videoName;         				
	         				li="<li><a href='"+href+"' title='"+videoName+"'><img src='"+img+"' alt='"+videoName+"'/><div class='info'><p class='video-name'>《"+videoName+"》</p><p class='sharer'>分享者："+sharer+"</p></div></a></li>";
	         				$("#video-list"+pid).prepend(li);
	         			})
	         		}
	         	}else{
	         		var li="<li><a href='"+href+"' title='"+videoName+"'><img src='"+img+"' alt='"+videoName+"'/><div class='info'><p class='video-name'>《"+videoName+"》</p><p class='sharer'>分享者："+sharer+"</p></div></a></li>";
	         		$("#video-list"+pid).prepend(li);
	         	}  										
			});
		})
	</script>
</head>
<body>
	<header class="header">
		<a href="javascript:history.go(-1)" class="reback"></a>
	</header>
	<nav class="nav">
		<a href="javascript:void(0)" class="active" tag="0">搞笑</a>
		<a href="javascript:void(0)" tag="1">广告短片</a>
		<a href="javascript:void(0)" tag="2">纪实</a>
		<a href="javascript:void(0)" tag="3">微电影</a>
		<a href="javascript:void(0)" tag="4">预告片</a>
		<a href="javascript:void(0)" tag="15">自媒体</a>
	</nav>
	<section class="container">
		<div class="banner plate-banner">
			<ul class="slides">
				<li><a href="video.html?pid=9" title="banner1"><img src="images/temp/banner/videoBanner01.jpg" alt="banner1" /></a></li>
				<li><a href="videoDetail.html?pid=4&id=414" title="banner2"><img src="images/temp/banner/videoBanner02.jpg" alt="banner2" /></a></li>
				<li><a href="#" title="banner3"><img src="images/temp/banner/videoBanner03.jpg" alt="banner3" /></a></li>
			</ul>
			<div class="decoration"></div>
		</div>
		<div class="gray-wrap">
			<div class="video-share">
				<a href="javascript:void(0)" id="share-btn"><span class="share-txt">我要分享</span><i class="share-ico"></i></a>				
			</div>
			<!--推荐视频-->
			<!--			
			<ul class="video-recomment clearfix">
				<li>
					<a href="videoDetail.html" title="X战警：天启">
						<img src="images/temp/video_372x372.jpg" alt="X战警：天启">
						<div class="info">
							<p class="video-name">《X战警：天启》</p>
							<p class="sharer">分享者：张全蛋</p>
						</div>
					</a>					
				</li>
				<li>
					<a href="videoDetail.html" title="谍影特工">
						<img src="images/temp/video_180x180.jpg" alt="谍影特工">
						<div class="info">
							<p class="video-name">《谍影特工》</p>
							<p class="sharer">分享者：张全蛋</p>
						</div>
					</a>					
				</li>
				<li>
					<a href="videoDetail.html" title="谍影特工">
						<img src="images/temp/video_180x180.jpg" alt="谍影特工">
						<div class="info">
							<p class="video-name">《谍影特工》</p>
							<p class="sharer">分享者：张全蛋</p>
						</div>
					</a>					
				</li>
			</ul>
			-->
			<div class="video-category">
				<!--<p class="title">轻松短片</p>-->
				<ul class="video-list clearfix" id="video-list0"></ul>
				<ul class="video-list clearfix hide" id="video-list1"></ul>
				<ul class="video-list clearfix hide" id="video-list2"></ul>
				<ul class="video-list clearfix hide" id="video-list3"></ul>
				<ul class="video-list clearfix hide" id="video-list4"></ul>
				<ul class="video-list clearfix hide" id="video-list5"></ul>
				<ul class="video-list clearfix hide" id="video-list6"></ul>
				<ul class="video-list clearfix hide" id="video-list7"></ul>
				<ul class="video-list clearfix hide" id="video-list8"></ul>
				<ul class="video-list clearfix hide" id="video-list9"></ul>
				<ul class="video-list clearfix hide" id="video-list10"></ul>
				<ul class="video-list clearfix hide" id="video-list11"></ul>
				<ul class="video-list clearfix hide" id="video-list12"></ul>
				<ul class="video-list clearfix hide" id="video-list13"></ul>
				<ul class="video-list clearfix hide" id="video-list14"></ul>
				<ul class="video-list clearfix hide" id="video-list15"></ul>
				<ul class="video-list clearfix hide" id="video-list16"></ul>
				<ul class="video-list clearfix hide" id="video-list17"></ul>
				<ul class="video-list clearfix hide" id="video-list18"></ul>
				<ul class="video-list clearfix hide" id="video-list19"></ul>
				<ul class="video-list clearfix hide" id="video-list20"></ul>
				<ul class="video-list clearfix hide" id="video-list21"></ul>
				<ul class="video-list clearfix hide" id="video-list22"></ul>
				<ul class="video-list clearfix hide" id="video-list23"></ul>
				<ul class="video-list clearfix hide" id="video-list24"></ul>
			</div>			
		</div>					
		<!--分享失败弹窗-->	
		<div id="share" class="mask hide">
			<div class="share-tip-box">
				<i class="close"></i>			
				<p>分享链接失败!</p>
			</div>
		</div>		
	</section>
	<footer class="footer">
		<ul class="menu clearfix">
			<li>
				<a href="index.html">
					<i class="icon ico-01 active"></i>
					<span>主页</span>
				</a>
			</li>
			<li>
				<a href="login.html" id="authentication">
					<i class="icon ico-02"></i>
					<span>认证上网</span>
				</a>
			</li>
			<li>
				<a href="social.html">
					<i class="icon ico-03"></i>
					<span>局域社交</span>
				</a>
			</li>
		</ul>
	</footer>	
</body>
</html>